package com.zh.risk.entity;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.naming.ldap.PagedResultsControl;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.Objects;

/**
 * code is far away from bug with the animal protecting
 * ┏┓　　　┏┓
 * ┏┛┻━━━┛┻┓
 * ┃　　　　　　　┃
 * ┃　　　━　　　┃
 * ┃　┳┛　┗┳　┃
 * ┃　　　　　　　┃
 * ┃　　　┻　　　┃
 * ┃　　　　　　　┃
 * ┗━┓　　　┏━┛
 * 　　┃　　　┃神兽保佑
 * 　　┃　　　┃代码无BUG！
 * 　　┃　　　┗━━━┓
 * 　　┃　　　　　　　┣┓
 * 　　┃　　　　　　　┏┛
 * 　　┗┓┓┏━┳┓┏┛
 * 　　　┃┫┫　┃┫┫
 * 　　　┗┻┛　┗┻┛
 *
 * @Description: 商户交易风控实体类
 * @Author: Liard
 * @Create in: 2020/7/11 9:12
 * @Version: 1.0.1
 */
@ApiModel(value = "商户风控基础信息类")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("elec_risk_merch_trans")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RiskMerchTrans extends Model<RiskMerchTrans> {

    private static final long serialVersionUID = -5025404214841921849L;

    @ApiModelProperty(value = "主键", name = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value = "规则编码", name = "code")
    private String code;
    @ApiModelProperty(value = "规则名称", name = "name")
    private String name;
    @ApiModelProperty(value = "卡类型(1.所有卡,2.借记卡,3.贷记卡)", name = "cardType")
    private Integer cardType;
    @ApiModelProperty(value = "操作对象(1,所有人,2.商户,3.持卡人,4.接口)", name = "operationType")
    private Integer operationType;
    @ApiModelProperty(value = "交易类型(1.所有类型,2.消费)", name = "transType")
    private String transType;
    @ApiModelProperty(value = "风险级别(1.低风险,2.中风险,3.高风险)", name = "level")
    private Integer level;
    @ApiModelProperty(value = "描述", name = "desc")
    private String description;
    @ApiModelProperty(value = "状态(1.启用，2.停用)", name = "status")
    private Integer status;
    @ApiModelProperty(value = "风控类型(1.全部,2.机构,3.代理,4.商户,5.系统,6.外部接口)", name = "type")
    private Integer type;
    @ApiModelProperty(value = "是否立即启用(1.实时性，2.延时性)", name = "timeliness")
    private Integer timeliness;
    @ApiModelProperty(value = "对应端点(1.商户客户端, 2.交易端点, 99.其它)", name = "target")
    private Integer target;
    @ApiModelProperty(value = "对应执行的方法名称)", name = "methodName")
    private String methodName;
    @ApiModelProperty(value = "创建时间", name = "createTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN")
    private Date createTime;
    @ApiModelProperty(value = "规则种类1.预先处理，2.抽象处理,3.特殊处理", name = "genre")
    private Integer genre;
    @ApiModelProperty(value = "命中规则分数", name = "score")
    private Integer score;
    @ApiModelProperty(value = "时间片", name = "num")
    private Integer num;
    @ApiModelProperty(value = "时间单位", name = "unit")
    private String unit;
    @ApiModelProperty(value = "显示标题", name = "title")
    @TableField(exist = false)
    private String title;
    @ApiModelProperty(value = "前端显示方向", name = "des")
    @TableField(exist = false)
    private String direction;
    @ApiModelProperty(value = "延时性的参数", name = "des")
    @TableField(exist = false)
    private String param;
}
